package com.fpt.edu.vn.h2tv.dao.entity;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * TbTagsId entity. @author MyEclipse Persistence Tools
 */
@Embeddable
public class TbTagsId implements java.io.Serializable {

	// Fields

	private String tag;
	private Integer bookid;

	// Constructors

	/** default constructor */
	public TbTagsId() {
	}

	/** full constructor */
	public TbTagsId(String tag, Integer bookid) {
		this.tag = tag;
		this.bookid = bookid;
	}

	// Property accessors

	@Column(name = "TAG", nullable = false)
	public String getTag() {
		return this.tag;
	}

	public void setTag(String tag) {
		this.tag = tag;
	}

	@Column(name = "BOOKID", nullable = false)
	public Integer getBookid() {
		return this.bookid;
	}

	public void setBookid(Integer bookid) {
		this.bookid = bookid;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof TbTagsId))
			return false;
		TbTagsId castOther = (TbTagsId) other;

		return ((this.getTag() == castOther.getTag()) || (this.getTag() != null
				&& castOther.getTag() != null && this.getTag().equals(
				castOther.getTag())))
				&& ((this.getBookid() == castOther.getBookid()) || (this
						.getBookid() != null && castOther.getBookid() != null && this
						.getBookid().equals(castOther.getBookid())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getTag() == null ? 0 : this.getTag().hashCode());
		result = 37 * result
				+ (getBookid() == null ? 0 : this.getBookid().hashCode());
		return result;
	}

}